package org.grayrabbit.cms.constant;

import java.io.InputStream;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class EmailService {

	private static final Logger LOG = LoggerFactory.getLogger(EmailService.class);
	
	/**发送人邮箱用户名*/
	public static final String EMAIL_LOGINNAME;
	
	/**邮箱密码*/
	public static final String EMAIL_PASSWORD;
	
	/**邮件服务器*/
	public static final String EMAIL_SERVER;
	
	/**端口*/
	public static final String EMAIL_PORT;
	
	/**传输格式*/
	public static final String EMAIL_FORMAT;
	
	static {
		Properties prop = new Properties();
		try {
			InputStream in = EmailService.class.getResourceAsStream("/config.properties");
			prop.load(in);
		}catch(Exception e) {
			LOG.info("异常：{}", e);
		}
		EMAIL_LOGINNAME = prop.getProperty("email.loginname", "/");
		EMAIL_PASSWORD = prop.getProperty("email.password", "/");
		EMAIL_SERVER = prop.getProperty("email.server", "/");
		EMAIL_PORT = prop.getProperty("email.port", "/");
		EMAIL_FORMAT = prop.getProperty("email.format", "/");
	}
}
